package com.yun.zhong.fu.demo.threadpool;

import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.util.concurrent.TimeUnit;

/**
 * @Author RenPu
 * @Date 2022/4/28 17:31
 * @Version 1.0
 * @Description:
 **/

@Service
public class Test {

    private volatile Notifier notifier = new Notifier();
    @PostConstruct
    public void init(){
        GolableExctor.submitDistroNotifyTask(notifier);
    }

    public class Notifier implements Runnable {

        @Override
        public void run() {
            for (; ; ) {
                try {
                    TimeUnit.SECONDS.sleep(1);
                    System.out.println("模仿spring-cloud-alibaba,编写异步调用任务=======================");

                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }


        }
    }
}
